<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>CMS</title>
    <link href="__CSS__/common.css" rel="stylesheet"/>
    <link href="__CSS__/right.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__INC__/form/css/zebra_form.css" type="text/css">
    <script language="javascript"> var publicUrlInc = "__INC__"; </script>
    <script type="text/javascript" language="javascript" src="__JS__/jquery-1.7.2.min.js"></script>
    <script language="javascript" src="__INC__/wxld/wxld.js"></script>
    <script language="javascript" src="__JS__/common.js"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $(".table_list tr").mouseover(function () {
                $(this).addClass("one");
            })
            $(".table_list tr").mouseout(function () {
                $(this).removeClass("one");
            })
        });
    </script>
    <style type="text/css">
        .one {
            background: #fcfcfc;
        }
    </style>
</head>
<body>
<!--右侧区域 begin-->
<div class="right">
    <!--当前位置 begin-->
    <include file='common:crumbs'/>
    <!--当前位置 end-->
    <!--主体区域 begin-->
    <div class="container">
        <div class="alert_div">
            <h4 class="alert_info">您现在的位置是：{$current} <span class="welcome">{$welcome}</span></h4>
            <h4 class="alert_what" style="display:none;"></h4>
        </div>
        <!--样式一 begin-->
        <div class="stats">
            <div class="lm_title">
                <div class="lm_title_l"><em>操作面板</em></div>
            </div>
            <div class="lm_content">
                <!-- 添加类别 -->
                <input type="hidden" name='cid' id="wxld" value="{$wxld}"/>
                <table class="Zebra_Form">
                    <tr class="row">
                        <td><label>筛选:</label></td>
                        <td>
                            <div class="select_ld"></div>
                        </td>
                        <td><input type="button" class="button" onclick="refresh()" value="列出该层级内容"/></td>
                    </tr>
                </table>
            </div>
            <div class="lm_bottom">
                <div class="lm_bottom_l"><em></em></div>
            </div>
        </div>
        <!--样式一 end-->
        <!--样式二 begin-->
        <div class="stats">
            <div class="lm_title">
                <div class="lm_title_l"><em>{$current}</em></div>
            </div>
            <div class="lm_table">
                <table cellpadding="0" cellspacing="0" width="100%" class="table_list">
                    <tr class="title" align="center">
                        <td>选择号</td>
                        <td>序号</td>
                        <td>标题</td>
                        <td>排序</td>
                        <td>操作</td>
                    </tr>
                    <volist name='list' id='vo'>
                        <tr class="tr_line">
                            <td colspan="10">
                                <div></div>
                            </td>
                        </tr>
                        <tr align="center" id="tr_{$vo.id}">
                            <td><input type="checkbox" name="_check[]" value="{$vo.id}"></td>
                            <td>{$vo.id}</td>
                            <td>{$vo.typename}</td>
                            <td><input type="text" id="order_{$vo.id}" value="{$vo.order}" maxlength="3" style="width:30px;"/></td>
                            <td>
                                <a onclick="updateOrder({$vo.id})" href="javascript:void(0)">更新排序</a> | <a onclick="del({$vo.id})" href="javascript:void(0)">删除</a>
                            </td>
                        </tr>
                    </volist>
                </table>
            </div>
            <div class="lm_table_bottom">
                <div class="lm_table_bottom_l">
                    <em>
                        <div class="select_btn"><input type="button" class="select_btn1" onclick="selAll()" value=""/>&nbsp;&nbsp;<input type="button" onclick="selRev()" class="select_btn2" value=""/></div>
                        <div class="page"></div>
                        <div class="clear"></div>
                    </em>
                </div>
            </div>
        </div>
        <!--样式二 end-->
    </div>
    <!--主体区域 end-->
</div>
<!--右侧区域  end-->
</body>
<script>
    function updateOrder(id) {
        var order = $("#order_" + id).val();
        if (!$.isNumeric(order)) {
            //kalert("序号必须是 0-999 之间的数字!");
            jl_notify("序号必须是 0-999 之间的数字!");
            return;
        }
        $.post("{:U('ajax/wxldajax')}", {
            action: 'update2',
            order: order,
            id: id
        }, function (data) {
            if (data != 1) {
                jl_notify(2, "呜呜，更新失败！");
                return;
            } else {
                //kalert("修改成功！");
                //location.href=location.href;
                jl_notify(1, "嘻嘻，更新成功！");
            }
        });
    }

    function del(id) {
        if (id == '') {
            kalert("没有选中任何项!");
            return;
        }
        $.post("{:U('ajax/wxldajax')}", {
            action: 'del2',
            id: id
        }, function (data) {
            if (data != 1) {
                jl_notify(2, "呜呜，删除失败！");
                return;
            } else {
                //kalert("删除成功！");
                //location.href=location.href;
                $("#tr_" + id).fadeOut(200);
                jl_notify(1, "嘻嘻，删除成功！");
            }
        });
    }

    //无限联动的回调函数
    /* function _wxldcallback(){
     var id = $("#wxld").val();
     location.href = "{:U('wxld/setOrder')}?fid="+id;
     } */

    function refresh() {
        var id = $("#wxld").val();
        location.href = "{:U('wxld/setOrder')}?fid=" + id;
    }

    $(function () {
        if ($("#wxld").val() == '')getLD('jl_wxld', 'id', 'fid', 'typename', 'id', 0);
        else  regetLD('jl_wxld', 'id', 'fid', 'typename', 'id', 0);
    });
</script>
</html>